{% extends '::layout.html.twig' %}

{% block javascripts %}
<script type='text/javascript'>
$(document).ready(function() {
    refresh();
});
       
function refresh(){
    $.ajax({
        type: "POST",
        url: "{{ path('project_planning_poker_refresh')}}",
        async: true,
        timeout: 50000,
        data: "get=true",
        success: function(data) {
        $("#userstory").empty();
        $("#userstory").append(data.userstory);
        $("#divnotes").empty();
        $("#divnotes").append(data.note);
        $("#divmessages").empty();
        $("#divmessages").append(data.message);
        setTimeout("refresh()", 1000);
        }
    });
}
    </script>
{% endblock %}

{% block title %}Planning Poker{% endblock%}

{% block titreNav %}Planning Poker{% endblock %}

{% block titreContent %}Planning Poker{% endblock %}

{% block titreBreadcrumbs %}
    <li><a href="#">Notez cet user story</a></li>
{% endblock %}

{% block contentnav %}
    <div class="widget">
        <div class="whead">
            <h6>Votre note :</h6>
            <div class="clear"></div>
        </div>
    </div>
    {% if currentNote != 0%}
    <ul class="middleNavS">
        <li style="height: 118px"><a style="height: 100px" href="#" ><img src="{{ asset('bundles/projectscrum/images/planningpoker/carte.png')}}" alt=""><span>{{ currentNote }}</span></a></li>
    </ul>
    {% endif %}
    {% if app.session.get('role') == "ROLE_SCRUMMASTER" %}
    <div class="sidePad">
        {% if userstory %}
            <a href="{{ path ("project_planning_poker_reassess")}}" title="" class="sideB bRed mt10"><span class="icol-refresh2"></span>Réévaluer</a>
        {% endif %}
        {% if currentNote != 0%}
            <a href="{{ path ("project_planning_poker_validate_note", {"note": currentNote} ) }}" title="" class="sideB bGreen mt10"><span class="icos-check"></span>Valider ma note</a>
        {% endif %}
        </div>   
{% endif %}
{% endblock %}

{% block content %}

        <br/>
        <h5><div id="userstory" style="text-align: center"></div></h5>

    {% if userstory %}
        <div class="divider"><span></span></div>

        <br/>
        <h6>Sélectionnez une difficulté :</h6>


        <ul class="middleNavS">
            <li style="height: 118px"><a style="height: 100px" href="{{ path ("project_planning_poker_send_note", {"note": 1} ) }}" ><img src="{{ asset('bundles/projectscrum/images/planningpoker/carte.png')}}" alt=""><span>1</span></a></li>
            <li style="height: 118px"><a style="height: 100px" href="{{ path ("project_planning_poker_send_note", {"note": 2} ) }}" ><img src="{{ asset('bundles/projectscrum/images/planningpoker/carte.png')}}" alt=""><span>2</span></a></li>
            <li style="height: 118px"><a style="height: 100px" href="{{ path ("project_planning_poker_send_note", {"note": 3} ) }}" ><img src="{{ asset('bundles/projectscrum/images/planningpoker/carte.png')}}" alt=""><span>3</span></a></li>
            <li style="height: 118px"><a style="height: 100px" href="{{ path ("project_planning_poker_send_note", {"note": 5} ) }}" ><img src="{{ asset('bundles/projectscrum/images/planningpoker/carte.png')}}" alt=""><span>5</span></a></li>
            <li style="height: 118px"><a style="height: 100px" href="{{ path ("project_planning_poker_send_note", {"note": 8} ) }}" ><img src="{{ asset('bundles/projectscrum/images/planningpoker/carte.png')}}" alt=""><span>8</span></a></li>
            <li style="height: 118px"><a style="height: 100px" href="{{ path ("project_planning_poker_send_note", {"note": 13} ) }}" ><img src="{{ asset('bundles/projectscrum/images/planningpoker/carte.png')}}" alt=""><span>13</span></a></li>

        </ul>

        <div class="divider"><span></span></div>

        <br/>

        <div class="fluid">
            <div class="widget grid12">
                <div class="whead">
                    <h6>Ensemble des notes :</h6>
                    <div class="clear"></div>
                </div>

            </div>
            <div id="divnotes"></div>
        </div>
        <div class="fluid">
            <div class="widget grid12">
                <div class="whead">
                    <h6>Point de vue :</h6>
                    <div class="clear"></div>
                </div>
                <div class="formRow">
                    <div id="divmessages"></div>

                    <div class="enterMessage">
                        <form action="{{ path('project_planning_poker_send_message') }}" id="message" method="post">
                            <input type="text" name="enterMessage" placeholder="Entrez votre message...">
                            <div class="sendBtn">
                                <input type="submit" name="sendMessage" class="buttonS bLightBlue" value="Envoyer">
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    {% endif %}

{% endblock %}
